package com.easy.easy.dao;

import com.easy.easy.bean.Order;
import com.easy.easy.bean.User;
import com.easy.easy.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderDao {
    @Options(useGeneratedKeys = true, keyProperty = "orderid")
    int add(@Param("order") Order order);

    int delivery(@Param("orderid") int orderid);

    List<Order> getOrderByUserId(@Param("userid") int userid);

    int getproduct(@Param("orderid") int orderid);

    int edit(@Param("order") Order order);

    int delete(@Param("orderid") int orderid,@Param("userid") int userid);

    int Delete(@Param("orderid") int orderid);

    List<Order> getList(@Param("page") Page page, @Param("text") String text, @Param("id") int userid);

    List<Order> getlist(@Param("page") Page page, @Param("text") String text);

    Order getOrderById(@Param("orderid") int orderid,@Param("userid") int userid);

    int getCount(@Param("text") String text,@Param("id") int userid);

    int getcount(@Param("text") String text);

    Order getOrder(@Param("order") Order order);

    int cancleOrder();

    Order getOrderByID(@Param("orderid") int orderid);

    int paymentSuccess(String code);


}
